/***弹出窗口调用***/
function openwindowclient(title,url,w,h)
{
	var diag = new Dialog('Dialog1');
	diag.Width = w;
	diag.Height = h;
	diag.Title = title;
	diag.URL = url;
	diag.show();
}
/*
$(document).ready(function() {
	$("#category").change( function ()
	{
		var catid = $("#category").val();
		if(catid!='0')//点击不限推荐位就不管
		{
			var str="";
			$("[name='checkboxes[]']").each(function(){
				if($(this).attr("checked"))
					str+=$(this).val()+",";
			});//读取所有选中项放入str
			if(str=="")	{
				alert("请至少选中一项才能进行[栏目转移]操作。");
			}
			else{
				if(window.confirm('单击“确定”继续[栏目转移]操作。单击“取消”停止。')){
					var ids = str.substring(0,str.length-1).split(",");
					var url = "/content/batchsetcategory/id/"+ids+"/catid/"+catid+"/";//+Math.random();
					$.ajax({
				        url: url,
				        cache: false,
				        success: function(html){
							PageClick(page);
							alert('恭喜您,栏目转移成功!');						
				        }
					});
				}
			}
		}
	}); 
});
function batchSetPositionAjax()
{
	var posid = $("#position").val();
	if(posid!='0')//点击不限推荐位就不管
	{
		var str="";
		$("[name='checkboxes[]']").each(function(){
			if($(this).attr("checked"))
				str+=$(this).val()+",";
		});//读取所有选中项放入str
		if(str=="")	{
			alert("请至少选中一项才能进行[推荐位设置]操作。");
		}
		else{
			if(window.confirm('单击“确定”继续[推荐位设置]操作。单击“取消”停止。')){
				var ids = str.substring(0,str.length-1).split(",");
				var url = "/content/batchsetposition/id/"+ids+"/posid/"+posid+"/";//+Math.random();
				$.ajax({
			        url: url,
			        cache: false,
			        success: function(html){
						alert('恭喜您,设置推荐位成功!');
			        }
				});
			}
		}
	}
}*/
function SetCheckStatusAjax()
{
	var catid = $("#catid").val();
	var contenttype = $("#contenttype").val();
	var status = $('#stepstatus').val();
	var str="";
	$("[name='checkboxes[]']").each(function(){
		if($(this).attr("checked"))
			str+=$(this).val()+",";
	});//读取所有选中项放入str
	if(str=="")	{
		alert("请至少选中一项才能进行[批准]操作。");
	}
	else{
		if(window.confirm('单击“确定”继续[批准]操作。单击“取消”停止。')){
			var ids = str.substring(0,str.length-1).split(",");
			var contenttype= $("#hdncontenttype").val();
			var url = "/content/setcheckstatus/contenttype/"+contenttype+"/id/"+ids+"/status/"+status+"/";//+Math.random();
			$.ajax({
		        url: url,
		        cache: false,
		        success: function(html){
					PageClick(page);
		        }
			});
		}
	}
}
function RecycleAjax(fn){
	var catid = $("#catid").val();
	var contenttype = $("#contenttype").val();
    var backurl = "/content/index"+contenttype+"/catid/"+catid+"/contenttype/"+contenttype+"/";
    var str="";
	$("[name='checkboxes[]']").each(function(){
		if($(this).attr("checked"))
			str+=$(this).val()+",";
	});//读取所有选中项放入str
	if(fn=="delete")
	{		
		if(str=="")	{
			alert("请至少选中一项才能进行[彻底删除]操作。");
		}
		else{
			if(window.confirm('单击“确定”继续[彻底删除]操作。单击“取消”停止。\r\n注：彻底删除前如有必要请先导出。否则将无法恢复。')){
				var ids = str.substring(0,str.length-1).split(",");
				var url = "/content/recycledelete/id/"+ids+"/contenttype/"+contenttype+"/";//+Math.random();
				//alert(url);
				$.ajax({
			        url: url,
			        cache: false,
			        success: function(html){
						PageClick(page);
			        }
				});
				//$.get(url);
				//for (i=0 ; i < ids.length ; i++){$('#tr_'+ids[i]).remove();}
			}
		}
	}
	else if(fn=="restore"){
		if(str=="")	{
			alert("请至少选中一项才能进行[还原]操作。");
		}
		else{
			if(window.confirm('单击“确定”继续[还原]操作。单击“取消”停止。')){	
				var ids = str.substring(0,str.length-1).split(",");
				var url = "/content/recyclerestore/id/"+ids+"/contenttype/"+contenttype+"/";//+Math.random();
				$.ajax({
			        url: url,
			        cache: false,
			        success: function(html){
						PageClick(page);
			        }
				});
				//$.get(url);
				//for (i=0 ; i < ids.length ; i++){$('#tr_'+ids[i]).remove();}
			}
		}
	}
	else if(fn=="deleteall"){
		if(window.confirm('单击“确定”继续[清空回收站]操作。单击“取消”停止。\r\n注：清空回收站前如有必要请先导出。否则将无法恢复。')){
			var url = "/content/recycledeleteall/catid/"+catid+"/contenttype/"+contenttype+"/"+Math.random();
			//alert(url);
			$.ajax({
		        url: url,
		        cache: false,
		        success: function(html){
					alert("[清空回收站]操作成功，点击“确定”返回管理页面。");
					window.location.href=backurl;
		        }
			});
			
		}
	}
	else if(fn=="restoreall"){
		if(window.confirm('单击“确定”继续[全部还原]操作。单击“取消”停止。')){
			var url = "/content/recyclerestoreall/catid/"+catid+"/contenttype/"+contenttype+"/"+Math.random();
			$.ajax({
		        url: url,
		        cache: false,
		        success: function(html){
					alert("[全部还原]操作成功，点击“确定”返回管理页面。");
					window.location.href=backurl;
		        }
			});
		}
	}		
}
/* 批量删除 */
$(function() {
$("#btnDelete").click(function(){
	var str="";
	$("[name='checkboxes[]']").each(function(){
		if($(this).attr("checked"))
			str+=$(this).val()+",";
	});//读取所有选中项放入str
	if(str=="")
	{
		alert("请至少选中一项才能进行[批量删除]操作。");
	}
	else
	{
		if(window.confirm('单击“确定”继续[批量删除]操作。单击“取消”停止。'))
		{
			var ids = str.substring(0,str.length-1).split(",");
			var contenttype = $("#hdncontenttype").val();
			var url = "/comment/delete/commentid/"+ids+"/";
			$.ajax({
		        url: url,
		        cache: false,
		        success: function(html){
					PageClick(page);
		        }
			});
		}
	}
});
});
/**
 * ajax op
 * @param id
 * @param url
 * @return
 */
function ajaxOp(op,id,url)
{
	if(op=='delete')
	{
		if(window.confirm('单击“确定”继续[删除]操作。单击“取消”停止。'))
	    {
			$.ajax({
		        url: url,
		        cache: false,
		        success: function(html){
					PageClick(page);
		        }
			});
	    }
	}
	else if(op=='isonline')
	{
		var id="isonline_"+id;
		var imgUrl = $('#'+id)[0].src;
		var strs = imgUrl.split("/");
		var imgName = strs[strs.length-1];
	   	if(imgName == 'online.gif')
	   	{
	   		if(window.confirm('单击“确定”继续[下线]操作。单击“取消”停止。'))
		    {
		   		url = url+'value/0/'+Math.random();
		   		$.get(url);
		   		$('#'+id)[0].src = "/images/manage/offline.gif";
		   		$('#'+id)[0].alt = "点击上线";
		    }
	   	}
	   	else
	   	{
	   		if(window.confirm('单击“确定”继续[上线]操作。单击“取消”停止。'))
	   		{
		   		url = url+'value/1/'+Math.random();
		   		$.get(url);
		   		$('#'+id)[0].src = "/images/manage/online.gif";
		   		$('#'+id)[0].alt = "点击下线";
	   		}
	   	}
	}
	else if(op=='checkok')
	{
		var id2="img_"+id;
		var imgUrl = $('#'+id2)[0].src;
		var strs = imgUrl.split("/");
		var imgName = strs[strs.length-1];
    	if(imgName == 'yes.gif')
    	{
    		url = url+'value/0/'+Math.random();
    		$.get(url);
    		$('#'+id2)[0].src = "/images/no.gif";
    	}
    	else
    	{
    		url = url+'value/1/'+Math.random();
    		$.get(url);
    		$('#'+id2)[0].src = "/images/yes.gif";
    	}
	}
	else{}
}
/* checkbox 全选 取消 */
$(function() { 
	 $("#checkedAll").click(function() {  
	 if ($(this).attr("checked") == true) { // 全选 
		 $(":checkbox").attr("checked", true); 
	 } else { // 取消全选 
		 $(":checkbox").attr("checked", false);
	 }
	}); 
});

/* 批量审核 */
$(function() {
$("#btnonline").click(function(){
	var str="";
	$("[name='checkboxes[]']").each(function(){
		if($(this).attr("checked"))
			str+=$(this).val()+",";
	});//读取所有选中项放入str
	if(str=="")
	{
		alert("请至少选中一项才能进行[批量审核]操作。");
	}
	else
	{
		if(window.confirm('单击“确定”继续[批量审核]操作。单击“取消”停止。'))
		{
			var ids = str.substring(0,str.length-1).split(",");
			var url = "/comment/batchisonline/id/"+ids+"/value/1/";
			$.ajax({
		        url: url,
		        cache: false,
		        success: function(html){
					PageClick(page);
		        }
			});
		}
	}
});
});
/*批量取消审核 */
$(function() {
$("#btnoffline").click(function(){
	var str="";
	$("[name='checkboxes[]']").each(function(){
		if($(this).attr("checked"))
			str+=$(this).val()+",";
	});//读取所有选中项放入str
	if(str=="")
	{
		alert("请至少选中一项才能进行[批量取消审核]操作。");
	}
	else
	{
		if(window.confirm('单击“确定”继续[批量取消审核]操作。单击“取消”停止。'))
		{
			var ids = str.substring(0,str.length-1).split(",");
			var url = "/comment/batchisonline/id/"+ids+"/value/0/";
			$.ajax({
		        url: url,
		        cache: false,
		        success: function(html){
					PageClick(page);
		        }
			});
		}
	}
});
});
<!--
/**
 * 页面样式js
 */
if (document.getElementById("listDiv"))
{
  document.getElementById("listDiv").onmouseover = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
        if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#F4FAFB';
      }
    }

  }

  document.getElementById("listDiv").onmouseout = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
          if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
      }
    }
  }
}

//-->